import sys

from PyQt5.QtCore import QUrl
from PyQt5.QtWidgets import QApplication
from PyQt5.QtWebEngineWidgets import QWebEngineView


def render(filename):
    app = QApplication(sys.argv)

    # 创建一个窗口
    view = QWebEngineView()

    # 加载网页
    url = QUrl('file:///./_html/' + filename + ".html")
    view.setUrl(url)

    # 显示窗口
    view.show()

    sys.exit(app.exec_())
